<?php

namespace App\Transformers;

use App\Models\Address;
use App\Models\User;
use League\Fractal\TransformerAbstract;

class AddressTransformer extends TransformerAbstract
{
    public function transform(Address $address)
    {
        return [
            'id' => $address->id,
            'name' => $address->name,
            'city_id' => $address->city_id,
            'city_name' => city_name($address->city_id),
            'phone' => $address->phone,
            'address' => $address->address,
            'create_at' => $address->create_at,
            'update_at' => $address->update_at
        ];
    }
}
